package com.qdnb.oss;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 该类来完成自动配置
 */
@Configuration
@EnableConfigurationProperties(AliyunOSSProperties.class)
public class AliyunOSSAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public AliyunOSSUtils aliyunOSSUtils(AliyunOSSProperties aliyunOSSProperties){
        AliyunOSSUtils aliyunOSSUtils = new AliyunOSSUtils();
        aliyunOSSUtils.setProperties(aliyunOSSProperties);
        return aliyunOSSUtils;
    }

}
